/*
# Rocket viewer is (c) BCNMedTech, UNIVERSITAT POMPEU FABRA
#
# Rocket viewer is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Rocket viewer is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# Authors:
# Carlos Yagüe Méndez
# María del Pilar García
# Daniele Pezzatini
# Contributors: 
# Sergio Sánchez Martínez
*/

import React, { Component } from 'react';

export default class RktToolboxTableInputsItem extends Component {

    constructor() {
        super();
        this.state = {
            
        };
    }

    onChangeInput(event) {

        this.setState({
            value:event.target.value
        })
    }

    getValue(){
        return this.state.value;
    }

    render() {

        var type = this.props.toolboxtableinputsitem.type;
        var name = this.props.toolboxtableinputsitem.name;
        var extra_info_name = this.props.toolboxtableinputsitem.extra_info_name;
        var placeholder = this.props.toolboxtableinputsitem.placeholder;

        return (
            <div className="grid-block vertical shrink rkt-toolbox-table-inputs-item">
                <label>{name+" "+extra_info_name}</label>
                <input type={type}
                    placeholder={placeholder}
                    onChange={this.onChangeInput.bind(this)}
                    value={this.state.value} />
            </div>
        );
    }
}